package io.gitee.chearnee.fw.web.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Getter;
import lombok.Setter;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author cn
 * @version 1.0
 * @description
 * @date 2021/9/23 18:44
 */
@Getter
@Setter
public class BaseEntity implements Serializable {

  @Serial
  private static final long serialVersionUID = 1L;
  @TableId(type = IdType.AUTO)
  private Long id;
  /**
   * 创建时间
   */
  private LocalDateTime createdAt;
  /**
   * 未删除0,删除id
   */
  @TableLogic(value = "0", delval = "id")
  @TableField(value = "is_deleted")
  private Long deleted;
}
